{%load i18n%}
{% spaceless %}
{%ifnotequal pages 1%}
{% if pages %}
<div class="paginator">
{% if has_next %}<span class="next"><a href="/search-results/&query={{query}}&page={{ next }}" title="{%trans "Next Page"%}">&laquo; {%trans "Next"%}</a></span>{% else %}<span class="next-na">&laquo; {%trans "Next"%}</span>{% endif %}

{% if not in_trailing_range %}
 ...
 {% for num in pages_outside_leading_range %}
  <span class="page"><a href="/search-results/&query={{query}}&page={{ num }}/" >{{ num }}</a></span>
 {% endfor %}
{% endif %}
 
{% for num in page_numbers reversed%}
  {% ifequal num page %}
    <span class="curr" title="{%trans "Current Page"%}">{{ num }}</span>
  {% else %}
     <span class="page"><a href="/search-results/&query={{query}}&page={{ num }}/" title="{%trans "Page"%} {{ num }}">{{ num }}</a></span>
  {% endifequal %}
{% endfor %}


{% if not in_leading_range %}
{% for num in pages_outside_trailing_range reversed%}
<span class="page"><a href="/search-results/&query={{query}}&page={{ num }}/" >{{ num }}</a></span>
{% endfor %}
...
{% endif %}

{% if has_previous %}<span class="prev"><a href="/search-results/&query={{query}}&page={{ previous }}/" title="{%trans "Previous Page"%}">{%trans "Previous"%} &raquo;</a></span>{% else %}<span class="prev-na">{%trans "Previous"%} &raquo;</span>{% endif %}
</div> 
{% endif %}
{%endifnotequal%}
{% endspaceless %}